﻿using ConfExpert.Forms.Base;
using System;
namespace ConfExpert.Forms.Kalite
{
    public partial class SerbestBirak : XForm
    {
        string RollIds;
        public SerbestBirak(string RollIds)
        {
            InitializeComponent();
            this.RollIds = RollIds;
            this.Text = RollIds;
        }

        private void SerbestBirak_Load(object sender, EventArgs e)
        {
            memoEdit1.TextChanged += memoEdit1_TextChanged;
            btnGo.Enabled = false;
            btnGo.ItemClick += btnGo_ItemClick;
        }

        void memoEdit1_TextChanged(object sender, EventArgs e)
        {
            btnGo.Enabled = memoEdit1.Text.Trim().Length > 5;
        }

        void btnGo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ExecuteNonQuery("ClearHoldFor", RollIds, memoEdit1.Text, WhoAmI);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
    }
}
